home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / objam01.lha / objam / runtime / include / clib / objc_protos.h
Encoding:
C/C++ Source or Header  |  1995-02-13  |  3.4 KB  |  88 lines

  1. /*
  2. ** ObjectiveAmiga: objc.library protos
  3. ** See GNU:lib/libobjam/ReadMe for details
  4. */
  5.  
  6.  
  7. #ifndef  CLIB_OBJC_PROTOS_H
  8. #define  CLIB_OBJC_PROTOS_H
  9.  
  10. #ifndef  EXEC_TYPES_H
  11. #include <exec/types.h>
  12. #endif
  13. #ifndef  LIBRARIES_OBJC_H
  14. #include <libraries/objc.h>
  15. #endif
  16.  
  17. #include <stddef.h>
  18.  
  19. /* NXZone emulation functions */
  20. NXZone * NXCreateZone(size_t startSize, size_t granularity, int canFree);
  21. NXZone * NXCreateChildZone(NXZone *parentZone, size_t startSize, size_t granularity, int canFree);
  22. void     NXMergeZone(NXZone *zone);
  23. NXZone * NXZoneFromPtr(void *ptr);
  24. void     NXDestroyZone(NXZone *zone);
  25. void   * NXZoneMalloc(NXZone *zone, int size);
  26. void   * NXZoneCalloc(NXZone *zone, int numElements, int elementSize);
  27. void   * NXZoneRealloc(NXZone *zone, void *block, int size);
  28. void     NXZoneFree(NXZone *zone, void *block);
  29. void     NXNameZone(NXZone *zone, const char *name);
  30. void     NXZonePtrInfo(void *ptr);
  31. NXZone * NXDefaultMallocZone(void);
  32. int      NXMallocCheck(void);
  33.  
  34. /* NXAtom emulation and string manipulation functions */
  35.  
  36. NXAtom   NXUniqueString(const char *buffer);
  37. NXAtom   NXUniqueStringWithLength(const char *buffer, int length);
  38. NXAtom   NXUniqueStringNoCopy(const char *buffer);
  39. char   * NXCopyStringBuffer(const char *buffer);
  40. char   * NXCopyStringBufferFromZone(const char *buffer, NXZone *zone);
  41.  
  42. /* ObjC support functions */
  43. void   * __objc_xmalloc(int size);
  44. void   * __objc_xmalloc_from_zone(int size, NXZone* zone);
  45. void   * __objc_xrealloc(void* mem, int size);
  46. void   * __objc_xcalloc(int nelem, int size);
  47. void     __objc_xfree(void *mem);
  48. void     objc_fatal(const char* msg);
  49. void     __objc_archiving_fatal(const char* format, int arg1);
  50.  
  51. /* Class related functions */
  52. id       class_create_instance(OCClass* class);
  53. id       class_create_instance_from_zone(OCClass* class, NXZone* zone);
  54. id       object_copy(id object);
  55. id       object_copy_from_zone(id object, NXZone* zone);
  56. id       object_dispose(id object);
  57.  
  58. /* Type encoding functions */
  59. int      objc_aligned_size(const char* type);
  60. int      objc_sizeof_type(const char* type);
  61. int      objc_alignof_type(const char* type);
  62. int      objc_aligned_size(const char* type);
  63. int      objc_promoted_size(const char* type);
  64. const char * objc_skip_type_qualifiers(const char* type);
  65. const char * objc_skip_typespec(const char* type);
  66. const char * objc_skip_offset(const char* type);
  67. const char * objc_skip_argspec(const char* type);
  68. int      method_get_number_of_arguments(struct objc_method* m);
  69. int      method_get_sizeof_arguments(struct objc_method* m);
  70. char   * method_get_first_argument(struct objc_method* m, arglist_t argframe, const char** type);
  71. char   * method_get_next_argument(arglist_t argframe, const char **type);
  72. char   * method_get_nth_argument(struct objc_method* m, arglist_t argframe, int arg, const char **type);
  73. unsigned objc_get_type_qualifiers(const char* type);
  74.  
  75. /* Sparse array functions */
  76. struct sarray * sarray_new(int size, void *default_element);
  77. void            sarray_free(struct sarray *array);
  78. struct sarray * sarray_lazy_copy(struct sarray *oarr);
  79. void            sarray_realloc(struct sarray *array, int new_size);
  80. void            sarray_at_put(struct sarray *array, sidx index, void* elem);
  81. void            sarray_at_put_safe(struct sarray *array, sidx index, void* elem);
  82. void            __objc_print_dtable_stats(void);
  83.  
  84. /* Private functions */
  85. BOOL     __objclib_init(struct __objclib_init_data *data);
  86.  
  87. #endif /* CLIB_OBJC_PROTOS_H */
  88.